/**
 * Copyright (c) 2006 eMundo GmbH. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 *
 * Project: agil-client-web
 * File: GwtRemoteService.java
 *
 */

package eu.emundo.agilpro.web.client;

import com.google.gwt.user.client.rpc.RemoteService;

import eu.emundo.agilpro.web.client.dto.GwtParameterDTO;

/**
 * Service-interface
 * 
 * @author Fabian Wohlschl\u00E4ger
 */
public interface GwtRemoteService extends RemoteService {
	/**
	 * Should be the first method to call
	 * 
	 * @throws Exception
	 */
	public void initConnection();
	
	/**
	 * Cancels the current action
	 * 
	 */
	public void cancelAction();

	/**
	 * Changes the role
	 * 
	 * @param pNewRole
	 *            newrole
	 * 
	 */
	public void changedRole(String pNewRole);

	/**
	 * Gets the activities for one role
	 * 
	 * @param pRole
	 *            role
	 * 
	 */
	public String[] getActivitiesForRole(String pRole);

	/**
	 * Gets the delayed activities for one role
	 * 
	 * @param pRole
	 *            role
	 * 
	 */
	public String[] getDelayedActivitesForRole(String pRole);

	/**
	 * Gets the roles
	 * 
	 * @return Roles
	 * 
	 */
	public String[] getRoles();

	/**
	 * Gets the url, which should be displayed at the client
	 * 
	 * @return null if a GenericUI should be displayed, otherwise the url is
	 *         returned
	 * 
	 */
	public String getUrl();

	/**
	 * Performs next action
	 * 
	 */
	public void nextAction();

	/**
	 * Delays the current action
	 * 
	 */
	public void delayAction();

	/**
	 * Starts an activity
	 * 
	 * @param pActivityName
	 *            Activity
	 * 
	 */
	public void startActivity(String pActivityName);

	/**
	 * Resumes an delayed activity
	 * 
	 * @param pDelayedActivityName
	 *            delayed activity
	 * 
	 */
	public void resumeDelayedActivity(String pDelayedActivityName);

	/**
	 * Gets the active action
	 * 
	 * @return Active action
	 * 
	 */
	public String getActiveAction();

	/**
	 * Gets the active activity
	 * 
	 * @return Active activity
	 * 
	 */
	public String getActiveActivity();

	/**
	 * Gets the active role
	 * 
	 * @return Active role
	 * 
	 */
	public String getActiveRole();

	/**
	 * Gets the parameters of an action
	 * 
	 * @return Parameters
	 * 
	 */
	public GwtParameterDTO getParameters();
	
	/**
	 * Gets the visible parameters of an action
	 * 
	 * @return Parameters
	 * 
	 */
	public GwtParameterDTO getVisibleParameters();

	/**
	 * Sets the parameters of an action
	 * 
	 * @param pDto
	 *            parameters
	 * 
	 */
	public void setParameters(GwtParameterDTO pDto);
	
	/**
	 * The flag is true when no Process is currently running
	 * 
	 * @return StopPollingFlag
	 */
	public boolean getStopPollingFlag();
}
